<?php

namespace App\Lib\Util;

class Func
{
    public static function checkDate($dateStr)
    {
        $patten = "/^\d{4}[\-](0?[1-9]|1[012])[\-](0?[1-9]|[12][0-9]|3[01])(\s+(0?[0-9]|1[0-9]|2[0-3])\:(0?[0-9]|[1-5][0-9])\:(0?[0-9]|[1-5][0-9]))?$/";
        if (preg_match($patten, $dateStr)) {
            return true;
        }
        return false;
    }
}
